﻿using System;
using System.Collections.Generic;
using Application.Domain;

namespace Application.Services
{
    public interface IService
    {
        /// <summary>
        /// Creates the person.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="firstname">The firstname.</param>
        /// <param name="lastname">The lastname.</param>
        /// <returns>The id if the operation was succcessful, 
        /// otherwise String.Empty</returns>
        string CreatePerson(string id, string firstname, string lastname);

        /// <summary>
        /// Deletes the person.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns>True is the operation was successful</returns>
        bool DeletePerson(string id);

        /// <summary>
        /// Gets all person.
        /// </summary>
        /// <returns></returns>
        IList<Person> GetAllPerson();

        /// <summary>
        /// Gets all person.
        /// </summary>
        /// <param name="sortExpression">The sort expression.</param>
        /// <param name="firstResult">The first result.</param>
        /// <param name="maxResults">The max results.</param>
        /// <returns></returns>
        IList<Person> GetAllPerson(string sortExpression, int firstResult,
            int maxResults);

        /// <summary>
        /// Gets the person by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        Person GetPersonById(string id);

        /// <summary>
        /// Gets the person count.
        /// </summary>
        /// <returns></returns>
        int GetPersonCount();

        /// <summary>
        /// Initializes the repository.
        /// </summary>
        void Initialize();

        /// <summary>
        /// Updates the person.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="firstname">The firstname.</param>
        /// <param name="lastname">The lastname.</param>
        /// <returns>True is the operation was successful.</returns>
        bool UpdatePerson(string id, string firstname, string lastname);

    }
}
